package com.sidianzhong.sdz.utils;

import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

public class Tools {

    public  static  String getUUID(){
        String uuid = UUID.randomUUID().toString().replaceAll("_", "");
        return  uuid;
    };
    public static String getOrderSN() {
        return UUID.randomUUID().toString().replace("-","").toUpperCase() ;
    }
    public static String humpToLine(String str) {
        return str.replaceAll("[A-Z]", "_$0").toLowerCase();
    }

    public static Date convertStringToDate(String date, String s) {
        SimpleDateFormat formatter = new SimpleDateFormat(s);
        ParsePosition pos = new ParsePosition(0);
        Date strtodate = formatter.parse(date, pos);
        return strtodate;
    }
}
